package org.jackysoft.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class DataItem implements Serializable,Cloneable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8042966246662678953L;
	private int id;
	private String label;
	private Double atomValue=0d;
	private Double accumulateValue=0d;
    private String remark;
    
    
	@Id
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public Double getAccumulateValue() {
		return accumulateValue;
	}

	public void setAccumulateValue(Double accumulateValue) {
		this.accumulateValue = accumulateValue;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getLabel() {
		return label;
	}

	public void setAtomValue(Double atomValue) {
		this.atomValue = atomValue;
	}

	public Double getAtomValue() {
		return atomValue;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getRemark() {
		return remark;
	}

	@Override
	public DataItem clone() {
		DataItem d = null;
		try{
			d = (DataItem) super.clone();
		}catch(CloneNotSupportedException e){
			return null;
		}
		return d;
	}
	
	public static DataItem EmptyDataItem(){
		DataItem t = new DataItem();
		t.setAtomValue(0D);
		t.setAccumulateValue(0D);
		return t;
	}
	
	
}
